#ifndef KEYWORD_DIALOG_H
#define KEYWORD_DIALOG_H

#include "keyword.h"
#include "apptab.h"

//(*Headers(KeywordDialog)
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/panel.h>
#include <wx/button.h>
//*)

class AppFrame;

class KeywordDialog: public wxPanel, public AppTab
{
	public:

		KeywordDialog(wxWindow* parent, AppFrame* top_frame, const Keyword& keyword);
		virtual ~KeywordDialog();

		bool isModified() const;
		int getID() const;

		//(*Declarations(KeywordDialog)
		wxTextCtrl* hints_box;
		wxStaticText* hints_label;
		wxButton* save_button;
		wxTextCtrl* name_box;
		wxButton* cancel_button;
		wxTextCtrl* aliases_box;
		wxTextCtrl* sortname_box;
		wxFlexGridSizer* fields_sizer;
		wxButton* name_button;
		wxStaticText* desc_label;
		wxTextCtrl* desc_box;
		wxStaticText* sortname_label;
		wxBoxSizer* top_sizer;
		wxButton* insert_source_button;
		wxStaticText* aliases_label;
		wxBoxSizer* buttons_sizer;
		//*)

	protected:
        AppFrame* top_frame;
        Keyword   keyword;

		//(*Identifiers(KeywordDialog)
		static const long ID_NAME_BOX;
		static const long ID_SORTNAME_BOX;
		static const long ID_ALIASES_BOX;
		static const long ID_HINTS_BOX;
		static const long ID_DESC_BOX;
		static const long ID_INSERT_SOURCE;
		static const long ID_NAME;
		//*)

	private:

		//(*Handlers(KeywordDialog)
		void OnCancel(wxCommandEvent& event);
		void OnSave(wxCommandEvent& event);
		void OnNameChanged(wxCommandEvent& event);
		void OnAliasesChanged(wxCommandEvent& event);
		void OnHintsChanged(wxCommandEvent& event);
		void OnSortnameChanged(wxCommandEvent& event);
		void OnInsertSource(wxCommandEvent& event);
		void OnName(wxCommandEvent& event);
		//*)
		void OnChildKeyDown(wxKeyEvent& event);

		DECLARE_EVENT_TABLE()
};

#endif
